<?php
/**
 * Field handler to provide class icons
 */
class mewdkp_handler_field_content_class extends views_handler_field {
	function render($values) {
		static $class = array();
		if (empty($class)) {
			$class = variable_get('mewdkp_lookup_class', array());
		}
		
		$value = $values->{$this->field_alias};
		
		$path = 'http://' . $_SERVER['HTTP_HOST'] . '/' . drupal_get_path('module', 'mewdkp') . '/images/icons/c'. $value .'.png';
		
		return '<img class="mewdkp-class-icon-small" src="'. $path .'" title="'. $class[$value] .'" />';
	}
}